package com.zx.config;/**
 * Author:JasonZ
 * Data:2023/4/14
 */

import com.netflix.loadbalancer.BestAvailableRule;
import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RoundRobinRule;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @program: ecommerce-parent
 *
 * @description:
 *
 * @author: JasonZ
 *
 * @create: 2023-04-14 10:44
 **/
@Configuration
public class RestConfig  {

   /* @Bean
    @LoadBalanced
    RestTemplate restTemplate(){
        return new RestTemplate();
    }

    @Bean
    IRule rule(){
        // 轮询策略
        return new RoundRobinRule();
        // 随机策略
//        return new RandomRule();
        // 启用重试机制
//        return new RetryRule();
//        return new BestAvailableRule();
    }*/
}
